Component({
  behaviors: [getApp().globalData.behavior],
  data: {
    show: false,
    date: "",
  },
  methods: {
    formatDate(date) {
      date = new Date(date);
      return `${date.getMonth() + 1}/${date.getDate()}`;
    },
    onConfirm(event) {
      const dates = [].concat(event.detail)
      this.setData({
        show: !this.data.show,
        date: dates.map(date => this.formatDate(date)).join(','),
      });
    },
    onNoticeClick() {
      this.setData({
        show: !this.data.show,
      });
    },
    onClose() {
      this.setData({
        show: !this.data.show,
      });
    },
  },
});
